<template>
    <view class="shop-entry-wrapper" @click="enterShop" v-if="name != ''">
        <image class="shop-logo" :src="logo" v-if="logo"></image>
        <image class="shop-logo" src="https://resource.migudm.cn/group1/M00/D1/C8/oYYBAGQhgfuANhn_AAAHoT1ekPg401.png" v-else></image>
        <view class="shop-name elps">{{ name }}</view>
        <image class="icon-arrow" src="https://ss.migudm.cn/malleoc/public/arrow_right.png" v-if="showLink"></image>
    </view>
</template>

<script>
    export default {
        props: {
            showLink: {
                type: Boolean,
                default: true
            },
            shopId: {
                type: [Number,String],
                default: 1
            },
            name: {
                type: String,
                default: ''
            },
            logo: {
                type: String,
                default: ''
            }
        },
        data() {
            return {

            };
        },
        mounted(){
        },
        methods: {
            enterShop() {
                if (!this.showLink) return
                let shopId = this.shopId
                if(this.shopId == null) shopId = 1
                this.$routeUtils.navigateTo({
				url: '/package_goods/shop/index?shopId=' + shopId
			});
            }
        },
    }
</script>

<style lang="scss" scoped>
    .shop-entry-wrapper {
        display: inline-flex;
        align-items: center;

        .shop-logo {
            width: 40rpx;
            height: 40rpx;
            margin-right: 8rpx;
            border-radius: 8rpx;
        }
        .shop-name {
            max-width: 300rpx;
            font-size: 30rpx;
            font-weight: 500;
            line-height: 40rpx;
            color: #333;
        }
        .icon-arrow {
            width: 24rpx;
            height: 24rpx;
        }
    }
</style>
